class Solution {
public:
    double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
        int m=nums1.size();
        int n=nums2.size();
        int j=m+n;
        for(int i=0;i<n;i++){
            nums1.push_back(nums2[i]);
        }
        sort(nums1.begin(),nums1.end());
        double ret=0;
        if(j%2==1)
            ret = nums1[j/2];
        else
            ret = ((double)nums1[j/2-1]+(double)nums1[j/2])/2;
        return ret;
    }
};
